package main

import "fmt"

func main() {
	array := []int{1, 2, 3, 4, 5, 6, 7, 8, 9}
	fmt.Println(array)
	rotate(array, 4)
	fmt.Println(array)
}

func rotate(s []int, n int) {
	n %= len(s)
	temp := append(s, s[:n]...)
	copy(s, temp[n:])

	//current := 0
	//temp := s[current]
	//for i := 0; i < len(s); i++ {
	//	prev = current - n
	//}
}
